package com.skwyb.form.core;

import com.skwyb.form.constants.ResultCode;
import lombok.Data;

@Data
public class ObjectResult {

    private Integer code;

    private String message;

    private Object value;

    public ObjectResult(Object value) {
        this.value = value;
        code = ResultCode.SUCCESS.getCode();
        message = "SUCCESS";
    }


    public ObjectResult(ResultCode codeEnum) {
        code = codeEnum.getCode();
        message = codeEnum.getMessage();
    }

    public ObjectResult(Integer code, String msg) {
        this.code = code;
        message = msg;
    }
}

